package com.piesat.quake.business.device.model.config;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.piesat.quake.business.device.mqtt.anno.CharField;
import com.piesat.quake.business.device.mqtt.anno.IgnoreField;
import com.piesat.quake.business.device.mqtt.anno.LengthField;

import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 *
 * </p>
 *
 * @author ${author}
 * @since 2023-03-13
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("d_ntp_data")
public class NtpData implements Serializable {

    private static final long serialVersionUID = 1L;

    @IgnoreField
    @TableId(value = "id", type = IdType.INPUT)
    private String id;

    //数据块长度	Int	4B	对于 5 NTP配置的数据块，整个数据块的长度；
    @LengthField
    @TableField(exist = false)
    private int length;
    //NTP对时主服务器	Char	32B	NTP对时主服务器的地址或域名，若NTP对时主地址长度小于32个字节，则空余的空间用字节0来补充；
    @CharField(32)
    @TableField("master")
    private String master;
    //NTP对时副服务器	Char	32B	NTP对时副服务器的地址或域名，若NTP对时副地址长度小于32个字节，则空余的空间用字节0来补充；
    @CharField(32)
    @TableField("slave")
    private String slave;


}
